<template>
  <div class="search">
    <f-form ref="form" :action="api.bbs" :form-key="this.formItem.bankStatementId" >
      <f-form-item label="认款ID"  name="paymentId" dataType="${formField.dataType}"   :value="formItem.paymentId" />
      <f-form-item label="流水号"  name="statementNo" dataType="${formField.dataType}"   :value="formItem.statementNo" />
      <f-form-item label="交易金额"  name="amount" dataType="${formField.dataType}"   :value="formItem.amount" />
      <f-form-item label="交易日期"  name="amountDate" dataType="${formField.dataType}"   :value="formItem.amountDate" />
      <f-form-item label="支付账户"  name="bankNo" dataType="${formField.dataType}"   :value="formItem.bankNo" />
      <f-form-item label="客户名称"  name="customName" dataType="${formField.dataType}"   :value="formItem.customName" />
      <f-form-item label="备注"  name="remark" dataType="${formField.dataType}"   :value="formItem.remark" />
      <f-form-item label="交易渠道"  name="amountType" dataType="${formField.dataType}"   :value="formItem.amountType" />
      <f-form-item label="摘要"  name="abstract" dataType="${formField.dataType}"   :value="formItem.abstract" />
      <f-form-item label="认款状态"  name="amountState" dataType="number"   :value="formItem.amountState" />
      <f-form-item label="创建时间"  name="createTime" dataType="${formField.dataType}"   :value="formItem.createTime" />
      <f-form-item label="更新时间"  name="updateTime" dataType="${formField.dataType}"   :value="formItem.updateTime" />
    </f-form>
  </div>
</template>
<script>
  import api from '../js/api'
  export default {
    name: 'bbsForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          bankStatementId: '',
          paymentId: '',
          statementNo: '',
          amount: '',
          amountDate: '',
          bankNo: '',
          customName: '',
          remark: '',
          amountType: '',
          abstract: '',
          amountState: '',
          createTime: '',
          updateTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.bankStatementId) {
          let params={
              bankStatementId:data.bankStatementId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
